<template>
  <div class="setting-main">
    <div class="nav-back-header">
      <div class="back-title">
        <div class="back-button">
          <img class="back-cover" src="@/assets/images/arrow-left.png" @click="onNavigationBack()"/>
        </div>
        <strong>话术设置</strong>
      </div>
    </div>
    <div class="setting-card">
      <div class="alter-content">
        每个分组都可以单独设置不同的话术
      </div>
      <div class="setting-table-wrap">
        <div class="table-header">
          <el-button size="small" type="primary" @click="dialogVisible = true">
            <i class="el-icon-plus"></i>
            添加话术
          </el-button>
          <div class="desc">
            话术：<i style="color: #2f54eb;margin-right: 8px;font-style:normal;">1/100</i>打招呼时会随机选择开启状态的话术进行打招呼
          </div>
        </div>
        <el-table :data="tableData" style="width: 100%">
          <el-table-column prop="id" label="编号" />
          <el-table-column prop="group" label="所属分组	" />
          <el-table-column prop="context" label="话术内容" />
          <el-table-column prop="context" label="打招呼通过数/打招呼总数" />
          <el-table-column prop="context" label="通过率" />
          <el-table-column prop="context" label="启用" />
          <el-table-column prop="option" label="操作" />
        </el-table>
      </div>
    </div>
    <el-dialog
      title="打招呼话术"
      :visible.sync="dialogVisible"
      width="40%"
      :before-close="handleClose">
      <el-input
        type="textarea"
        placeholder="请输入话术内容"
        v-model="textarea"
        maxlength="50"
        :rows="6"
        show-word-limit
      />
      <span slot="footer" class="dialog-footer">
        <el-button @click="dialogVisible = false">取消</el-button>
        <el-button type="primary" @click="dialogVisible = false">保存</el-button>
      </span>
    </el-dialog>
  </div>
</template>
<script>
export default {
  data() {
    return {
      dialogVisible: false,
      textarea: null,
      dataSource: []
    }
  },
  methods: {
    onNavigationBack(){
      this.$router.go(-1);
    }
  },
}
</script>
<style lang="scss" scoped>
.setting-main {
  .nav-back-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    position: sticky;
    top: 0;
    z-index: 8;
    height: 46px;
    padding: 0 20px;
    background: #fff;
    border-bottom: 1px solid #e9e9e9;
    .back-title {
      display: flex;
      align-items: center;
      font-size: 14px;
      line-height: 22px;
      .back-button {
        display: flex;
        justify-content: center;
        align-items: center;
        padding: 0;
        margin-right: 12px;
        border: none;
        width: 24px;
        height: 24px;
        background: #4b5a95;
        border-radius: 12px;
        cursor: pointer;
        .back-cover {
          width: 16px;
          height: 16px;
        }
      }
    }
  }
  .setting-card {
    overflow: auto;
    padding: 12px;
    .alter-content {
      background-color: #fffbe6;
      border: 1px solid #ffe58f;
      padding: 8px 15px;
      font-size: 14px;
      line-height: 22px;
      color: rgba(0,0,0,.85);
    }
    .setting-table-wrap {
      .table-header {
        display: flex;
        align-items: center;
        padding: 12px;
        background-color: #fff;
        border-left: 1px solid #e9e9e9;
        border-right: 1px solid #e9e9e9;
        .desc {
          margin-left: 16px;
          font-size: 14px;
        }
      }
    }
  }
}
</style>